package com.lagou.controller;

import com.lagou.bean.Person;
import com.lagou.service.Neo4jPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
public class IndexController {
    @Autowired
    private Neo4jPersonService articleService;

    @RequestMapping("/index")
    public String toIndex(Model model) {
        return "client/index";
    }

    @RequestMapping("/getData")
    @ResponseBody
    public List<Person> getData() {
        List<Person> persons = articleService.getPath("王启年", "九品射手燕小乙");
        return persons;
    }

}
